package org.vineatoum.business;

import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

import org.vineatoum.business.abstraction.BusinessAbstract;
import org.vineatoum.business.configuration.OenologicalProductType;
import org.vineatoum.business.configuration.ProducerOeno;
import org.vineatoum.view.utils.jtablecustom.TableListener;


public class OenologicalProduct extends BusinessAbstract {
	public static List<OenologicalProduct> products = new ArrayList<OenologicalProduct>(); //FIXME
	//FIXME Enum instead ?
	public OenologicalProductType substanceType;
	public String name;
	//FIXME Database entry ?
	public ProducerOeno producer;
	public String lotNumber;
	
	public OenologicalProduct() {
		super();
		
		products.add(this);
	}
	
	@Override
	public TableListener getNewInstance() {
		return new OenologicalProduct();
	}
	
	@Override
	public Vector<String> getVectorColumns() {
		Vector<String> columns = new Vector<String>();
		columns.add("Nom");
		columns.add("Type");
		columns.add("Fabricant");
		columns.add("Né de lot");
		return columns;
	}
	@Override
	public Vector<Object> getVectorData() {
		Vector<Object> vector = new Vector<Object>();
		vector.add(name);
		vector.add(substanceType);
		vector.add(producer);
		vector.add(lotNumber);
		
		return vector;
	}
	@Override
	public void updateField(String field, Object value) {
		// TODO Auto-generated method stub
		
	}

	public OenologicalProductType getSubstanceType() {
		return substanceType;
	}

	public void setSubstanceType(OenologicalProductType oenologicalProductType) {
		this.substanceType = oenologicalProductType;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public ProducerOeno getProducer() {
		return producer;
	}

	public void setProducer(ProducerOeno producer) {
		this.producer = producer;
	}

	public String getLotNumber() {
		return lotNumber;
	}

	public void setLotNumber(String lotNumber) {
		this.lotNumber = lotNumber;
	}
}
